# Flow-IPC: Shared Memory
# Copyright 2023 Akamai Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in
# compliance with the License.  You may obtain a copy
# of the License at
#
#   https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the License is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing
# permissions and limitations under the License.

@0xa6923814235da58a; # Manually generated by `capnp id` and saved here for all time.

using Cxx = import "/capnp/c++.capnp";

# The following section is, informally, this schema file's *header*.
# Recommendation: copy-paste relevant pieces into other schema files + follow similar conventions in this
# and other library+API combos.
#
# Header BEGIN ---

# Quick namespace reference:
# - ipc::transport::struc::shm: Globally used for all IPC transport structured layer with SHM-related matters in
#   Flow-IPC library+API.
#   - schema: Indicates the symbols therein are auto-generated by capnp from a schema such as in this file.
$Cxx.namespace("ipc::transport::struc::shm::schema");

# --- common.capnp ---
# This schema defines generally SHM-applicable types, including structs and aliases, for Flow-IPC users.

# --- END Header.

struct ShmHandle
{
  serialization @0 :Data;
  # shm::Builder::Session-concept pointee impl lend_object() returns this as a C++ flow::util::Blob_sans_log_context
  # as of this writing.
  # Use transport::struc::shm::capnp_set_lent_shm_handle() to mutate after geting Blob from lend_object().
  # Use transport::struc::shm::capnp_get_shm_handle_to_borrow() to access before passing Blob to borrow_object().
}
